<?php

class FileLogRoute extends CFileLogRoute
{
	protected function processLogs($logs)
	{
		for($i = 0, $iLength = count($logs); $i < $iLength; $i ++)
		{
			if(isset($logs[$i][0]) && is_string($logs[$i][0]))
			{
				$logs[$i][0] .= "\n" . 'REMOTE_ADDR = ' . $_SERVER['REMOTE_ADDR'] . ' ( ' . gethostbyaddr($_SERVER['REMOTE_ADDR']) . ' ) ';
				if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
				{
					$logs[$i][0] .= "\n" . 'HTTP_X_FORWARDED_FOR = ' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ' ( ' . gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']) . ' ) ';
				}
				$logs[$i][0] .= "\n-----\n";
			}
		}
		parent::processLogs($logs);
	}
}